with Ada.Text_Io;
with Ada.Integer_Text_Io;
use Ada.Text_Io;
use Ada.Integer_Text_Io;

---------------------------------------------------------
-- Coordinates paketet. Implementerar de funktioner    --
-- och procedurer som krävs för att skapa en           --
-- koordinatlista.                                     --
---------------------------------------------------------
package body Coordinates is


   function Get_Key(Coord : in Coordinate_type) return Integer is
   begin
      return Coord.number;
   end Get_Key;

    function "<"(Left,Right : in Coordinate_Type) return Boolean is
   begin
      return Left.number < Right.number;
   end "<";

   function ">"(Left,Right : in Coordinate_Type) return Boolean is
   begin
      return Left.number > Right.number;
   end ">";

   function "="(Left,Right : in Coordinate_Type) return Boolean is
   begin
      return Left.number = Right.number;
   end "=";

   procedure Set_Coordinates(Coord : in out Coordinate_Type;
                             X : in Integer;
                             Y : in Integer;
                             Z : in Integer) is
   begin
      Coord.Coordinates(1) := X;
      Coord.Coordinates(2) := Y;
      Coord.Coordinates(3) := Z;
   end Set_Coordinates;

   procedure Set_Number(Coord : in out Coordinate_Type;
                        Number: in Integer) is
   begin
      Coord.Number := Number;
   end Set_Number;

   function Get_Coordinates(Coord : in Coordinate_Type) return Int_Vector is
      Output : Int_Vector;
   begin
      Output := Coord.Coordinates;
      return Output;
   end Get_Coordinates;

   procedure Put(item : in Coordinate_Type) is
   begin
      Put("Koordinat nummer ");
      Put(Item.Number,1);
      Put(": (");
      Put(Item.Coordinates(1),1);
      Put(",");
      Put(Item.Coordinates(2),1);
      Put(",");
      Put(Item.Coordinates(3),1);
      Put(")");
      New_Line;
   end Put;

end Coordinates;

